-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enforce a limit of 50 URNs per contact #1301
Conversation
@@ -60,9 +60,16 @@ func (m *URNsModifier) Apply(eng flows.Engine, env envs.Environment, sa flows.Se | |||
log(events.NewErrorf("'%s' is not valid URN", urn)) | |||
} else { | |||
if m.Modification == URNsAppend || m.Modification == URNsSet { | |||
modified = contact.AddURN(urn, nil) | |||
if len(contact.URNs()) >= flows.MaxContactURNs { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the error message says we allow 50 so we use > flows.MaxContactURNs
and not >= flows.MaxContactURNs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is checking if the modifier should be allowed to add one more URN tho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I think the unit test added should not be an error as that has exactly 50 urns, we need one more urn to have that as error and use >
comparison
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the unit test is adding 50 urns but the contact already has 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh right
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1301 +/- ##
=======================================
Coverage 81.74% 81.75%
=======================================
Files 276 276
Lines 21326 21332 +6
=======================================
+ Hits 17434 17440 +6
Misses 3318 3318
Partials 574 574 ☔ View full report in Codecov by Sentry. |
No description provided.